package com.bjfu.intelligentrecognizeserver.mapper;

import com.bjfu.intelligentrecognizeserver.pojo.entity.RecommendInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommonMapper {
    //查询推荐信息
    @Select("select * from recommendinfo")
    List<RecommendInfo> getRecommendInfo();

    @Select("select phylum from men where kingdom_id = #{jieId}")
    List<String> getMenByJieId(Integer jieId);

    @Select("select class from gang where kingdom_id = #{jieId}")
    List<String> getGangByJieId(Integer jieId);

    @Select("select `order` from mu where kingdom_id = #{jieId}")
    List<String> getMuByJieId(Integer jieId);
    @Select("select family from ke where kingdom_id = #{jieId}")
    List<String> getKeByJieId(Integer jieId);

    @Select("select genus from shu where kingdom_id = #{jieId}")
    List<String> getShuByJieId(Integer jieId);
    @Select("select category from category")
    List<String> getCategoryByJieId(Integer jieId);

    @Select("select id from jie where kingdom = #{jie}")
    Integer selectJieIdByJie(String jie);

    @Select("select id from men where phylum = #{men}")
    Integer selectMenIdByMen(String men);

    @Select("select id from gang where class = #{gang}")
    Integer selectGangIdByGang(String gang);

    @Select("select id from mu where `order` = #{mu}")
    Integer selectMuIdByMu(String mu);

    @Select("select id from ke where family = #{ke}")
    Integer selectKeIdByKe(String ke);

    @Select("select id from shu where genus = #{ke}")
    Integer selectShuIdByShu(String shu);
    @Select("select id from category where category = #{zhong}")
    Integer selectCategoryIdByCategory(String zhong);
}
